Skip to content

BEHAVIOR: generate phase space with NumPy - #599

Open
redeboer wants to merge 4 commits into
dependabot/lock-2fb387fa0bfrom
phasespace-numpy-backend
Open

redeboer wants to merge 4 commits into
dependabot/lock-2fb387fa0bfrom
phasespace-numpy-backend

Conversation

@redeboer

@redeboer redeboer commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

⚙️ Enhancements

  • Supports Python 3.14 and 3.15. TensorFlow has no wheels for these versions yet (tensorflow/tensorflow#102890), so the tf extra installs nothing there and the NumPy, JAX, and Numba backends remain available.

⚠️ Interface changes

Old name New name
TFPhaseSpaceGenerator PhaseSpaceGenerator
TFWeightedPhaseSpaceGenerator WeightedPhaseSpaceGenerator
phsp and pwa extras installing TensorFlow Install the tf extra explicitly when TensorFlow is needed, for example for TFSummary or backend="tensorflow"

❗ Behavioral changes

  • Generates phase space samples with NumPy by default instead of TensorFlow, which changes the samples for a given seed. Select backend="tensorflow" with TFUniformRealNumberGenerator to retain the previous values.

🖱️ Developer experience

  • Adds a tensorflow pytest marker. Tests parametrized over a TensorFlow backend or RNG are marked automatically, and marked tests are skipped when TensorFlow is not installed, so the test suite runs on Python 3.14 and 3.15.

📝 Documentation

  • Updates the documentation and examples to the backend-neutral names and NumPy random numbers, and describes on the installation page which extras each phase space backend needs.

Squash commit messages

* BREAK: remove TF phase space generator names
* BREAK: require the tf extra for TensorFlow
* ENH: support Python 3.14 and 3.15
* MAINT: skip TensorFlow tests if it is not installed

@redeboer redeboer added this to the 0.5.0 milestone Nov 7, 2026
@redeboer redeboer added ❗ Behavior Changes that may affect the framework output ⚙️ Enhancement Improvements and optimizations of existing features labels Nov 7, 2026
@redeboer redeboer self-assigned this Nov 7, 2026

@redeboer redeboer left a comment •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'TensorWaves benchmark results'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 7ae7351 Previous: d87354f Ratio
benchmarks/expression.py::test_fit[1000-ScipyMinimizer-numpy] 7.278418512982209 iter/sec (stddev: 0.000798621735155104) 16.113062913278878 iter/sec (stddev: 0.0002623519931624775) 2.21
benchmarks/expression.py::test_fit[1000-ScipyMinimizer-numba] 7.135644490745856 iter/sec (stddev: 0.0015734880573458573) 16.217841898876852 iter/sec (stddev: 0.0003193217998612972) 2.27
benchmarks/expression.py::test_fit[1000-ScipyMinimizer-tf] 0.6077344978805652 iter/sec (stddev: 0.022967021085928248) 1.4043607630131383 iter/sec (stddev: 0.0016402295685287915) 2.31
benchmarks/unbinned_nll.py::test_unbinned_nll_normalization_formula[original-numpy] 29.16207799344516 iter/sec (stddev: 0.0017729495617012552) 80.89992620132578 iter/sec (stddev: 0.0014910944339774205) 2.77
benchmarks/unbinned_nll.py::test_unbinned_nll_normalization_formula[original-tensorflow] 57.43488428452988 iter/sec (stddev: 0.0018626743835165162) 129.63414209598676 iter/sec (stddev: 0.0002041886279346019) 2.26
benchmarks/unbinned_nll.py::test_unbinned_nll_normalization_formula[optimized-numpy] 36.84259935711421 iter/sec (stddev: 0.0021106539680015453) 126.61085086393801 iter/sec (stddev: 0.0007772448410810061) 3.44
benchmarks/unbinned_nll.py::test_unbinned_nll_normalization_formula[optimized-tensorflow] 59.93395257823824 iter/sec (stddev: 0.0015899874211372483) 160.31611202220606 iter/sec (stddev: 0.0002920427106502862) 2.67
benchmarks/unbinned_nll.py::test_unbinned_nll_estimator[numpy] 119.37586458864193 iter/sec (stddev: 0.0022454294748264192) 333.18786869068646 iter/sec (stddev: 0.0008835784608970419) 2.79
benchmarks/unbinned_nll.py::test_unbinned_nll_estimator[numba] 97.95784093013958 iter/sec (stddev: 0.0013096238324108408) 534.0952050682405 iter/sec (stddev: 0.0009391258569386208) 5.45

This comment was automatically generated by workflow using github-action-benchmark.

@redeboer redeboer added 🖱️ DX Improvements to the Developer Experience 📝 Docs Improvements or additions to documentation labels Nov 7, 2026
@redeboer redeboer changed the title ENH: support selecting the phase space backend ENH: drop TF prefix from phase space generators Nov 9, 2026
@redeboer
redeboer force-pushed the phasespace-numpy-backend branch from 048622d to 47dba74 Compare November 17, 2026 21:18
@redeboer redeboer changed the title ENH: drop TF prefix from phase space generators ENH: support NumPy phase space generation Nov 17, 2026
@redeboer redeboer added ⚠️ Interface Breaking changes to the API and removed 🖱️ DX Improvements to the Developer Experience labels Nov 17, 2026
@redeboer
redeboer marked this pull request as ready for review November 17, 2026 21:18
@redeboer
redeboer changed the base branch from main to support-phasespace-2 November 17, 2026 22:09
@redeboer
redeboer added this pull request to stack #607 November 17, 2026 22:09
@redeboer redeboer changed the title ENH: support NumPy phase space generation BEHAVIOR: generate phase space with NumPy Nov 17, 2026
@redeboer redeboer added the 🖱️ DX Improvements to the Developer Experience label Nov 17, 2026
@redeboer redeboer modified the milestones: 0.6.0, 0.5.0 Nov 18, 2026
@redeboer
redeboer force-pushed the phasespace-numpy-backend branch 4 times, most recently from 6392678 to b729c09 Compare November 18, 2026 09:56
@redeboer
redeboer removed this pull request from stack #607 November 18, 2026 10:32
@redeboer
redeboer changed the base branch from support-phasespace-2 to dependabot/lock-2fb387fa0b November 18, 2026 10:33
@redeboer
redeboer added this pull request to stack #610 November 18, 2026 10:33
@redeboer
redeboer force-pushed the phasespace-numpy-backend branch from b729c09 to 623dc67 Compare November 18, 2026 10:49
@redeboer redeboer removed 📝 Docs Improvements or additions to documentation 🖱️ DX Improvements to the Developer Experience labels Nov 18, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

❗ Behavior Changes that may affect the framework output ⚙️ Enhancement Improvements and optimizations of existing features ⚠️ Interface Breaking changes to the API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generate phase space samples without TensorFlow by default

1 participant